#ifndef DYELIBRARYUI_H
#define DYELIBRARYUI_H

#include <QDialog>
#include "addnewdye.h"
#include "DyelibraryService.h"
#include "ConfigFileservice.h"
#include "custommessagebox.h"

namespace Ui {
class TargetWidget;
}

class TargetWidget : public QDialog
{
    Q_OBJECT

public:
    explicit TargetWidget(QDialog *parent = nullptr);
    ~TargetWidget();

signals:
    void okExport();

public slots:
    void changeFilterCondition(int index);
    void renderNewDyeInfo(QList<QHash<QString, QString>> allDyeInfos, bool isDefault);
    void filterTargetTable();

private:
    Ui::TargetWidget *ui;

    int filterType;
    AddNewDye *addNDye;
    ConfigFileService *configFileService;
    DyeLibrary *DLDB;
    QList<QHash<QString, QString>> allDyeInfos;
    CustomMessageBox *cusMsg;

    void addNewDyeLibInfoToDB(AddNewDye::DyeStruct);
    void reviseDyeTable(int, int);



};

#endif // DYELIBRARYUI_H
